﻿using System;

namespace Communication.Message
{
	// Token: 0x0200000E RID: 14
	public abstract class ChannelMessage
	{
		// Token: 0x14000001 RID: 1
		// (add) Token: 0x06000097 RID: 151 RVA: 0x000027FA File Offset: 0x000009FA
		// (remove) Token: 0x06000098 RID: 152 RVA: 0x00002813 File Offset: 0x00000A13
		public event MessageCompletedEventHandler OnCompleted;

		// Token: 0x06000099 RID: 153
		public abstract ChannelMessageType GetMessageType();

		// Token: 0x0600009A RID: 154
		public abstract int GetSendData(byte[] buffer, int offset);

		// Token: 0x0600009B RID: 155
		public abstract int GetCancelSendData(byte[] buffer, int offset);

		// Token: 0x0600009C RID: 156
		public abstract int FillReceivedData(byte[] receivedDatas, int offset, int length);

		// Token: 0x0600009D RID: 157
		public abstract void SetTotalReceiveTimeoutMillis(int timeoutMillis);

		// Token: 0x0600009E RID: 158
		public abstract int GetTotalReceiveTimeoutMillis();

		// Token: 0x0600009F RID: 159
		public abstract void SetSpaceReceiveTimeoutMillis(int timeoutMillis);

		// Token: 0x060000A0 RID: 160
		public abstract int GetSpaceReceiveTimeoutMillis();

		// Token: 0x060000A1 RID: 161
		public abstract void SetSendTimeoutMillis(int timeoutMillis);

		// Token: 0x060000A2 RID: 162
		public abstract int GetSendTimeoutMillis();

		// Token: 0x060000A3 RID: 163
		public abstract bool SetCancel();

		// Token: 0x060000A4 RID: 164
		public abstract bool Cancel();

		// Token: 0x060000A5 RID: 165
		public abstract bool IsRequestCancel();

		// Token: 0x060000A6 RID: 166
		public abstract bool IsCancelled();

		// Token: 0x060000A7 RID: 167
		public abstract bool IsDone();

		// Token: 0x060000A8 RID: 168
		public abstract bool SetFailure(Exception cause);

		// Token: 0x060000A9 RID: 169
		public abstract Exception GetCause();

		// Token: 0x060000AA RID: 170
		public abstract bool IsSuccess();

		// Token: 0x060000AB RID: 171
		public abstract void AwaitUninterruptibly();

		// Token: 0x060000AC RID: 172
		public abstract bool AwaitUninterruptibly(int timeoutMillis);

		// Token: 0x060000AD RID: 173
		protected abstract void Reset();

		// Token: 0x060000AE RID: 174 RVA: 0x0000282C File Offset: 0x00000A2C
		protected void NotifyMessageCompleted(ChannelMessage sender)
		{
			if (this.OnCompleted != null)
			{
				this.OnCompleted(sender);
			}
		}

		// Token: 0x060000AF RID: 175 RVA: 0x00002842 File Offset: 0x00000A42
		protected void ClearCompletedHandler()
		{
			this.OnCompleted = null;
		}
	}
}
